import numpy as np

M = np.array([[1,2,3],[4,5,6]])
# 转置方法1
M_t = M.transpose()
# 转置方法2
M_t2 = M.T
print(f"源矩阵 M:\n{M}")
print(f"转置 M_t:\n{M_t}")
print(f"转置 M_t2:\n{M_t2}")